pub struct Solution;

impl Solution {
    pub fn is_palindrome(x: i32) -> bool {
        if x < 0 { return false; }
        let mut vec1 = Vec::new();
        let mut tmp = x;
        while tmp!= 0 {
            let i = tmp % 10;
            vec1.push(i);
            tmp = tmp / 10;
        }
        for i in 0..vec1.len() / 2 {
            if vec1[i]!= vec1[vec1.len() - i - 1] {
                return false;
            }
        }
        true
    }
}